Draft: Parser warning message when <gazebo> reference does not exist in URDF#1392
Draft: Parser warning message when <gazebo> reference does not exist in URDF#1392aagrawal05 wants to merge 9 commits intogazebosim:sdf14from
Conversation
ahcorde
left a comment
There was a problem hiding this comment.
If you check the diff, the indentation in your changes is very wierd. Do you mind to fix it ?
22e332a to
e538eb2
Compare
Hi, I took a look at it—I think there was something wrong with my text editor, it showed a different output and I hadn't noticed earlier. Let me fix it now. |
|
Ok, sorry about the many commits—I think the formatting should be fixed now. I'll make sure everything fits with rigorously with |
Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
Signed-off-by: Aditya Agrawal <58559719+aagrawal05@users.noreply.github.com> Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
Signed-off-by: Aditya Agrawal <58559719+aagrawal05@users.noreply.github.com> Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
Signed-off-by: Aditya Agrawal <58559719+aagrawal05@users.noreply.github.com> Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
ab47435 to
2d221fe
Compare
|
@traversaro would you be able to take a look at this? |
|
Thanks @aagrawal05 ! I guess it could make sense to do something similar with joints as well, but even just with links this PR is already quite useful. |
Thanks @traversaro, I will take a look into it. Please let me know if anything further is to be done. |
|
@aagrawal05 did you mean to close this PR? |
Whoops yeah sorry, I must have clicked the wrong button! |
|
Ok I've added the other extensions and tests, please take a look. |
Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
58b71c9 to
d610aa9
Compare
Signed-off-by: Aditya Agrawal <agraw17107@gapps.uwcsea.edu.sg>
|
Ok all the above changes should be addressed—I was mistaken about how the reference works. This passes all the tests now and should be ready. Please let me know if anything further is needed, @azeey. |
| sdf::ParserConfig config; | ||
| parser.InitModelString(str, config, &sdfResult); | ||
|
|
||
| EXPECT_PRED2(sdf::testing::contains, buffer.str(), |
There was a problem hiding this comment.
Can you add a comment here why the two link1s are not the same? I believe the і (https://www.compart.com/en/unicode/U+0456) in <gazebo reference="lіnk1"> is the issue.
| parser.InitModelString(str, config, &sdfResult); | ||
|
|
||
| EXPECT_PRED2(sdf::testing::contains, buffer.str(), | ||
| "<link> tag reference[link1] does not exist" |
There was a problem hiding this comment.
Shouldn't the error message reference visual1?
| "<link> tag reference[link1] does not exist" | |
| "<link> tag reference[visual1] does not exist" |
There was a problem hiding this comment.
Yep looking into this. I'be tried using _elem->Attribute("name") but that doesn't give it either-often giving the link or something different. Similarly the sdfVisualName doesn't seem correct. I'm tracing the code to see if there's an easy way to get the refString from parseURDF but it's taking a bit longer because of my unfamiliarity with the codebase. Please let me know if my approach is correct.
| parser.InitModelString(str, config, &sdfResult); | ||
|
|
||
| EXPECT_PRED2(sdf::testing::contains, buffer.str(), | ||
| "<link> tag reference[link1] does not exist" |
There was a problem hiding this comment.
| "<link> tag reference[link1] does not exist" | |
| "<link> tag reference[collision1] does not exist" |
| sdf::ParserConfig config; | ||
| parser.InitModelString(str, config, &sdfResult); | ||
|
|
||
| EXPECT_PRED2(sdf::testing::contains, buffer.str(), |
There was a problem hiding this comment.
Can you comment why the two joint1s are different?
azeey
left a comment
There was a problem hiding this comment.
Some syntax errors in the URDF.
| <box> | ||
| <size>1 1 1</size> | ||
| </box> |
There was a problem hiding this comment.
| <box> | |
| <size>1 1 1</size> | |
| </box> | |
| <box size="1 1 1"/> |
There was a problem hiding this comment.
Yep, will add to next commit
| <size>1 1 1</size> | ||
| </box> | ||
| </geometry> | ||
| <material> |
There was a problem hiding this comment.
| <material> | |
| <material name="mat1"> |
| "<joint> tag reference[joint1] does not exist" | ||
| " in the URDF model. Please ensure that the reference attribute" | ||
| " matches the name of a joint."); | ||
| } |
There was a problem hiding this comment.
I've noticed with this PR that even properly working URDFs print a warning message. Do you mind adding a test with a URDF that has a correct reference and check that there is no warning printed.
There was a problem hiding this comment.
Yep ran into this while addressing the previous point. Will do.
|
Apologies for the delay in resolving this PR. Finding a solution is taking longer than expected and I am currently traveling. I will try to push my changes by the end of this week. |
🎉 New feature
Closes #1372
Summary
Added functionality to emit a warning when a reference to a link does not exists by adding a check in the
InsertSDFExtensionLinkmethod.Test it
I've added the
ParseGazeboRefDoesntExistWarningMessagetest which adds the test case mentioned from #1372 with conflicting U+0069 and U+0456 characters.Checklist
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-bymessages.